<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */

$this->title = Yii::$app->name;
?>
<style>
    img{
        height: auto;
        width: auto\9;
        width: 100%;
    }
</style>
<div class="site-index">

    <div class="jumbotron">
        <p>买家收货后微信扫描二维码打开小程序。</p>
        <p>买家输入订单号、小程序显示商家预置信息。</p>
        <p>买家上传好评截图，等待商家审核，审核通过后自动收到微信红包。</p>
        <p>商家印刷统一固定二维码放入商品</p>
        <p>商家后台设置领红包规则说明</p>
        <p>商家后台授权各电商平台店铺</p>
        <p>商家人工审核所有领红包申请</p>
        <p>系统自动发放微信红包</p>
        <p>多维度统计：按平台、按店铺、按天、按月</p>
        <div class="auth-app-index">

            <?= GridView::widget([
                'dataProvider' => $dataProvider,
                'filterModel' => false,
                'summary'=>'',
                'showHeader'=>false,
                'columns' => [
                    [
                        'attribute'=>'logo',
                        'options' => ['width' => '100px'],
//                'filter'=>false,
                        'format'=>'raw',
                        'value'=>function($model){
                            return $model->showLogo();
                        }
                    ],
                    [
                        'attribute'=>'title',
//                        'options' => ['width' => '200px'],
//                'filter'=>false,
                        'format'=>'raw',
                        'value'=>function($model){
                            return $model->title;
                        }
                    ],
                    [
                        'attribute'=>'state',
                        'filter'=>false,
                        'format'=>'raw',
                        'value'=>function($model){
                            if($model->state==1){
                                $btn = Html::a('去授权', ['/weixin/login'], ['class' => 'btn btn-success']);
                            }
                            if($model->state==2){
                                $btn = Html::button('即将上线', ['class' => 'btn btn-warning']);
                            }
                            if($model->state==3){
                                $btn = Html::button('开发中',['class' => 'btn btn-info']);
//                        $btn = Html::a('开发中', ['#here'], ['class' => 'btn btn-default']);
                            }
                            return $btn;
                        }
                    ],
                ],
            ]); ?>


        </div>

    </div>

    <div class="body-content">

    </div>
</div>
